var _util = require('util/util.js')
var vue = require('./../common/vue')
const { toHandlerKey } = require('vue');
const _market_service = require('service/market-service');
const _catalog_service = require('../../service/catalog-service');
const _order_service = require('service/order-service')
const _statics_service = require('service/statics-service')

var browsing_records = new vue({
    el: "#browsing_records",
    data: {
        browsingrecords : [
            {
                username : "hsj",
                itemid : 100,
                time : "2022-7-1",
                description : "休闲穿搭",
                shopname : "自律母婴店"
            },
            {
                username : "hsj",
                itemid : 100,
                time : "2022-7-1",
                description : "休闲穿搭",
                shopname : "自律母婴店"
            },
            {
                username : "hsj",
                itemid : 100,
                time : "2022-7-1",
                description : "休闲穿搭",
                shopname : "自律母婴店"
            },
            {
                username : "hsj",
                itemid : 100,
                time : "2022-7-1",
                description : "休闲穿搭",
                shopname : "自律母婴店"
            } 
        ],
        edittime : "",
        editusername : "",
        pagesize : 8,
        pageid : 1
    },
    methods: {
        search: function () {
            console.log(this.editorderid)
            _statics_service.getbrowsingrecordsby(browsing_records.editusername,browsing_records.edittime,
                browsing_records.pagesize,
                browsing_records.pageid,
                function (res) {
                    console.log(res)
                    browsing_records.orders = [res];
                },
                function (err) {
                    console.log(err);
                })
        },
        setsearchtime : function(){
            this.edittime = $("#editsearchtime").val()
            console.log(this.edittime)
        },
        resetsearchinfo : function(){
            this.editusername = "请输入用户名";
        }
    },
    //初始化vue对象，渲染数据
    created: function () {
        _statics_service.getallbrowsingrecords(8,1,
            function (res) {
                console.log(res)
                browsing_records.orders = res.records;
            },
            function (res) {
                console.log("ERROR..*..")
            }
        );
    },

})